package cn.itcast;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;
//@EnableCircuitBreaker //启用服务熔断
//@EnableDiscoveryClient  //启用注册中心eureka
//@SpringBootApplication
@EnableFeignClients //启用Feign
@SpringCloudApplication //这个注解包括了上面那三个注解
public class ConsumerApplication {
/*    @Bean            由于启用了Feign动态代理生成url,所以RestTemplate这里就不用了
    @LoadBalanced //负载均衡
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }*/

    public static void main(String[] args) {
        SpringApplication.run(ConsumerApplication.class,args);
    }
}
